package io.xxx.xbutler.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum GenderType {

    UNKNOWN(0), MALE(1), FEMALE(2);

    private final int code;

    public static GenderType valueOf(int code) {
        for (GenderType genderType : GenderType.values()) {
            if (genderType.code == code) {
                return genderType;
            }
        }
        return UNKNOWN;
    }
}
